﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Generator : Generator_Basic
{
    //public GameObject Father;
    public string Tag;
    //static string StaticName;
    public Vector3 Scale;
    //static Vector3 StaticScale;
    public Vector3 Rotation;
    public Vector3 Location;
    override protected void Start()
    {
        //Debug.Log("Generator: "+theName);
        //StaticName = theName;
        //StaticEular = Eular;
        //StaticScale = Scale;
        base.Start();
        Generate();
    }

    override protected void SetTag()
    {
        theTag = Tag;
    }

    virtual public void Generate()
    {
        //Debug.Log("Generate " + theTag + " called");
        GameObject obj = GetComponent<PoolManager>().RealPools[theTag].GetObject();
        Transform rec = obj.transform;
        //rec.SetParent(Father.transform);
        rec.localScale = Scale;
        rec.position = Location;
        rec.Rotate(Rotation);
    }
}